package com.xauto.pioneer.appuser.model;

import org.json.JSONObject;

/**订单详情对象
 * Created by Ellis.Li on 2017/5/12.
 */
public class CarOrderInfo extends BaseModel<CarOrderInfo> {

    /** 车辆订单ID*/
    public String car_order_id;
    /** 车辆订单编号*/
    public String car_order_no;
    /** 车辆订单状态ID*/
    public String car_order_status_id;
    /** 车辆订单状态名称*/
    public String car_order_status_name;
    public String order_start_time;
    public String order_end_time;
    public String order_charge_start_time;
    public String order_charge_end_time;
    public String total_amount="";
    public BillChargeInfo billing_charge_info=null;
    public CarInfo carInfo;
    public ReserveInfo reserveInfo;
    public Member member_info;
    public ParkingSite parking_site_info;
    public  String total_amount_format;
    /**测试总公里数*/
    public  String test_total_kilometer;
    /** 车辆使用优惠券*/
    public MemberCoupon member_voucher_info;
    @Override
    public CarOrderInfo parse(JSONObject jsonObject) {
        if(jsonObject != null) {
            car_order_id = jsonObject.optString("car_order_id");
            car_order_no = jsonObject.optString("car_order_no");
            car_order_status_id = jsonObject.optString("car_order_status_id");
            car_order_status_name = jsonObject.optString("car_order_status_name");
            order_start_time = jsonObject.optString("order_start_time");
            order_end_time = jsonObject.optString("order_end_time");
            order_charge_start_time = jsonObject.optString("order_charge_start_time");
            order_charge_end_time = jsonObject.optString("order_charge_end_time");
            total_amount = jsonObject.optString("total_amount");
            total_amount_format = jsonObject.optString("total_amount_format");
            test_total_kilometer= jsonObject.optString("test_total_kilometer");
            carInfo = new CarInfo().parse(jsonObject.optJSONObject("car_info"));
            billing_charge_info = new BillChargeInfo().parse(jsonObject.optJSONObject("billing_charge_info"));
            reserveInfo = new ReserveInfo().parse(jsonObject.optJSONObject("reserve_info"));
            member_info = new Member().parse(jsonObject.optJSONObject("member_info"));
            parking_site_info = new ParkingSite().parse(jsonObject.optJSONObject("parking_site_info"));
            member_voucher_info= new MemberCoupon().parse(jsonObject.optJSONObject("member_voucher_info"));
            return this;
        }
        return null;
    }
}
